(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 11.3' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[     16579,        349]
NotebookOptionsPosition[     16190,        333]
NotebookOutlinePosition[     16596,        350]
CellTagsIndexPosition[     16553,        347]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"Begin", "[", "\"\<`Private`\>\"", "]"}], ";"}], 
  "\[IndentingNewLine]", "\[IndentingNewLine]", 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"--", "-"}], "*", " ", "Auto", " ", "completion", " ", "function",
     " ", "*", 
    RowBox[{"--", "-"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{"FileNameJoin", "[", 
    RowBox[{"{", 
     RowBox[{
     "$InstallationDirectory", ",", "\"\<SystemFiles\>\"", ",", 
      "\"\<FrontEnd\>\"", ",", "\"\<SystemResources\>\"", ",", 
      "\"\<FunctionalFrequency\>\"", ",", "\"\<specialArgFunctions.tr\>\""}], 
     "}"}], "]"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", 
  
  RowBox[{"(*", "\[IndentingNewLine]", "  ", 
   RowBox[{
    RowBox[{
     RowBox[{"https", ":"}], "//", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{"mathematica", ".", "stackexchange", ".", "com"}], "/", 
         "questions"}], "/", "56984"}], "/", "argument"}], "-", "completions",
       "-", "for", "-", "user", "-", "defined", "-", 
      RowBox[{"functions", "#129910"}]}]}], ";", "\[IndentingNewLine]", 
    "\[IndentingNewLine]", "  ", 
    RowBox[{"Argument", " ", 
     RowBox[{"codes", ":", "\[IndentingNewLine]", "  ", 
      RowBox[{
      "Normal", " ", "argument", "   ", "0", "\n", "    ", "AbsoluteFilename",
        "  ", "2", "\n", "    ", "RelativeFilename", "  ", "3", "\n", "    ", 
       "Color", "             ", "4", "\n", "    ", "PackageName", "       ", 
       "7", "\n", "    ", "DirectoryName", "     ", "8", "\n", "    ", 
       "InterpreterType", "   ", "9"}]}]}]}], "\[IndentingNewLine]", 
   "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"addCompletion", ":=", 
    RowBox[{
     RowBox[{"FE`Evaluate", "[", 
      RowBox[{"FEPrivate`AddSpecialArgCompletion", "[", "#", "]"}], "]"}], 
     "&"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", 
  "\[IndentingNewLine]", 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"--", "-"}], "*", " ", "Data", " ", "bases", " ", "*", 
    RowBox[{"--", "-"}]}], "*)"}], "\[IndentingNewLine]", 
  RowBox[{"(*", " ", "$PointGroups", " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"keysPG", "=", 
    RowBox[{"Keys", "@", "$PointGroups"}]}], ";"}], "\[IndentingNewLine]", 
  "\[IndentingNewLine]", 
  RowBox[{"(*", " ", "$LaueClasses", " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"keysLC", "=", 
    RowBox[{"Keys", "@", "$LaueClasses"}]}], ";"}], "\[IndentingNewLine]", 
  "\[IndentingNewLine]", 
  RowBox[{"(*", " ", "$SpaceGroups", " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"keysSG", "=", 
    RowBox[{"Keys", "@", "$SpaceGroups"}]}], ";"}], "\[IndentingNewLine]", 
  "\[IndentingNewLine]", 
  RowBox[{"(*", " ", 
   RowBox[{"$GroupSymbolRedirect", " ", 
    RowBox[{"(", 
     RowBox[{"non", "-", "formatted"}], ")"}]}], " ", 
   "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"keysRD", "=", 
    RowBox[{"Select", "[", 
     RowBox[{
      RowBox[{"Keys", "@", "$GroupSymbolRedirect"}], ",", 
      RowBox[{
       RowBox[{"!", 
        RowBox[{"StringContainsQ", "[", 
         RowBox[{"#", ",", 
          RowBox[{"{", "\"\<\\!\>\"", "}"}]}], "]"}]}], "&"}]}], "]"}]}], 
   ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", 
  RowBox[{"(*", " ", "$CrystalData", " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"keysCD", "=", 
    RowBox[{"Keys", "@", "$CrystalData"}]}], ";"}], "\[IndentingNewLine]", 
  "\[IndentingNewLine]", 
  RowBox[{"(*", " ", "$PeriodicTable", " ", "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"keysPT", "=", 
    RowBox[{"Keys", "@", "$PeriodicTable"}]}], ";"}], "\[IndentingNewLine]", 
  "\[IndentingNewLine]", 
  RowBox[{
  "(*", " ", "$TransformationMatrices", " ", "*)"}]}], "\[IndentingNewLine]", 

 RowBox[{
  RowBox[{
   RowBox[{"keysTM", "=", 
    RowBox[{"Keys", "@", "$TransformationMatrices"}]}], ";"}], 
  "\[IndentingNewLine]", "\[IndentingNewLine]", 
  RowBox[{"(*", 
   RowBox[{"-", 
    RowBox[{"*", " ", "Mix", " ", "*", "-"}]}], 
   "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"keysRDCD", "=", 
    RowBox[{"Join", "[", 
     RowBox[{"keysRD", ",", "keysCD"}], "]"}]}], ";"}], "\[IndentingNewLine]",
   "\[IndentingNewLine]", "\[IndentingNewLine]", 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"--", "-"}], "*", " ", "Enabling", " ", "auto", " ", "completion",
     " ", "for", " ", "symbols", " ", "*", 
    RowBox[{"--", "-"}]}], "*)"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Scan", "[", 
   RowBox[{"addCompletion", ",", "\[IndentingNewLine]", "\[IndentingNewLine]", 
    RowBox[{"{", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"\"\<AttenuationCoefficient\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<BraggAngle\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<CrystalDensity\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<CrystalFormulaUnits\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<CrystalPlot\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<DarwinWidth\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<DistortStructure\>\"", "\[Rule]", 
       RowBox[{"{", 
        RowBox[{"keysCD", ",", "0", ",", "0"}], "}"}]}], ",", 
      "\[IndentingNewLine]", 
      RowBox[{"\"\<EmbedStructure\>\"", "\[Rule]", 
       RowBox[{"{", 
        RowBox[{"keysCD", ",", "0", ",", "keysCD", ",", "0"}], "}"}]}], ",", 
      "\[IndentingNewLine]", 
      RowBox[{"\"\<EquivalentIsotropicADP\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<ExpandCrystal\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<ExportCrystalData\>\"", "\[Rule]", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"\"\<DIFFUSE\>\"", ",", "\"\<DISCUS\>\""}], "}"}], ",", 
         "keysCD", ",", "2"}], "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<ExtinctionLength\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<GetAtomicScatteringFactor\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<GetCrystalMetric\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<GetElements\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<GetLatticeParameters\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<GetLaueClass\>\"", "\[Rule]", 
       RowBox[{"{", "keysRDCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<GetScatteringCrossSection\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<GetSymmetryData\>\"", "\[Rule]", 
       RowBox[{"{", 
        RowBox[{"keysRDCD", ",", "\[IndentingNewLine]", 
         RowBox[{"{", 
          RowBox[{
          "\"\<Centring\>\"", ",", "\"\<CrystalSystem\>\"", ",", 
           "\"\<GroupType\>\"", ",", "\"\<HallString\>\"", ",", 
           "\[IndentingNewLine]", "\"\<HermannMauguinFull\>\"", ",", 
           "\"\<HermannMauguinShort\>\"", ",", "\"\<LaueClass\>\"", ",", 
           "\[IndentingNewLine]", "\"\<Lookup\>\"", ",", "\"\<MainEntryQ\>\"",
            ",", "\"\<PointGroupNumber\>\"", ",", "\"\<SpaceGroupNumber\>\"", 
           ",", "\[IndentingNewLine]", "\"\<Symbol\>\""}], "}"}]}], 
        "\[IndentingNewLine]", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<GetSymmetryOperations\>\"", "\[Rule]", 
       RowBox[{"{", "keysRDCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<ImportCrystalData\>\"", "\[Rule]", 
       RowBox[{"{", "2", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<InputCheck\>\"", "\[Rule]", 
       RowBox[{"{", "\[IndentingNewLine]", 
        RowBox[{"0", ",", "\[IndentingNewLine]", 
         RowBox[{"{", 
          RowBox[{
          "\"\<1hkl\>\"", ",", "\"\<1xyz\>\"", ",", "\"\<Integer\>\"", ",", 
           "\"\<Multiple\>\"", ",", "\"\<StringSymbol\>\"", ",", 
           "\"\<WrapSingle\>\"", ",", "\[IndentingNewLine]", 
           "\"\<CrystalQ\>\"", ",", "\[IndentingNewLine]", 
           "\"\<GetCentringVectors\>\"", ",", 
           "\"\<GetCrystalFormulaUnits\>\"", ",", "\[IndentingNewLine]", 
           "\"\<GetCrystalSpaceGroup\>\"", ",", 
           "\"\<GetCrystalWavelength\>\"", ",", "\"\<GetEnergyWavelength\>\"",
            ",", "\[IndentingNewLine]", "\"\<GetPointSpaceGroupCrystal\>\"", 
           ",", "\[IndentingNewLine]", "\"\<InterpretElement\>\"", ",", 
           "\"\<InterpretSpaceGroup\>\"", ",", "\[IndentingNewLine]", 
           "\"\<PointGroupQ\>\"", ",", "\"\<PointSpaceGroupQ\>\"", ",", 
           "\[IndentingNewLine]", "\"\<Polarisation\>\"", ",", 
           "\[IndentingNewLine]", "\"\<ProcessWavelength\>\""}], "}"}]}], 
        "\[IndentingNewLine]", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<InterplanarSpacing\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<MergeSymmetryEquivalentReflections\>\"", "\[Rule]", 
       RowBox[{"{", "keysRDCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<ReciprocalSpaceSimulation\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<ReflectionList\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<RelatedFunctionsGraph\>\"", "\[Rule]", 
       RowBox[{"{", "\[IndentingNewLine]", 
        RowBox[{"Sort", "[", 
         RowBox[{"First", "/@", 
          RowBox[{"DeleteCases", "[", 
           RowBox[{
            RowBox[{"Flatten", "@", 
             RowBox[{"First", "@", "$MaXrdFunctions"}]}], ",", "\"\<\>\""}], 
           "]"}]}], "]"}], "\[IndentingNewLine]", "}"}]}], ",", 
      "\[IndentingNewLine]", 
      RowBox[{"\"\<SimulateDiffractionPattern\>\"", "\[Rule]", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"\"\<DIFFUSE\>\"", ",", "\"\<DISCUS\>\""}], "}"}], ",", 
         "keysCD", ",", "0"}], "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<StructureFactor\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<StructureFactorTable\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<SymmetryEquivalentPositions\>\"", "\[Rule]", 
       RowBox[{"{", "keysRDCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<SymmetryEquivalentReflections\>\"", "\[Rule]", 
       RowBox[{"{", "keysRDCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<SymmetryEquivalentReflectionsQ\>\"", "\[Rule]", 
       RowBox[{"{", "keysRDCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<SynthesiseStructure\>\"", "\[Rule]", 
       RowBox[{"{", 
        RowBox[{"keysCD", ",", "0", ",", "0"}], "}"}]}], ",", 
      "\[IndentingNewLine]", 
      RowBox[{"\"\<SystematicAbsentQ\>\"", "\[Rule]", 
       RowBox[{"{", "keysRDCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<ToStandardSetting\>\"", "\[Rule]", 
       RowBox[{"{", "keysRDCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<UnitCellTransformation\>\"", "\[Rule]", 
       RowBox[{"{", "keysCD", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<$CrystalData\>\"", "\[Rule]", 
       RowBox[{"{", "\[IndentingNewLine]", 
        RowBox[{"keysCD", ",", "\[IndentingNewLine]", 
         RowBox[{"{", 
          RowBox[{
          "\"\<AtomData\>\"", ",", "\"\<ChemicalFormula\>\"", ",", 
           "\"\<FormulaUnits\>\"", ",", "\[IndentingNewLine]", 
           "\"\<LatticeParameters\>\"", ",", "\"\<Notes\>\"", ",", 
           "\"\<SpaceGroup\>\"", ",", "\"\<Wavelength\>\""}], "}"}]}], 
        "\[IndentingNewLine]", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<$LaueClasses\>\"", "\[Rule]", 
       RowBox[{"{", "keysLC", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<$PeriodicTable\>\"", "\[Rule]", 
       RowBox[{"{", "keysPT", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<$PointGroups\>\"", "\[Rule]", 
       RowBox[{"{", "keysPG", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<$SpaceGroups\>\"", "\[Rule]", 
       RowBox[{"{", "keysSG", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<$TransformationMatrices\>\"", "\[Rule]", 
       RowBox[{"{", "keysTM", "}"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{"\"\<$GroupSymbolRedirect\>\"", "\[Rule]", 
       RowBox[{"{", "keysRD", "}"}]}]}], "\[IndentingNewLine]", "}"}]}], 
   "]"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"End", "[", "]"}], ";"}]}], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.7174929072201157`*^9, 3.717492909690868*^9}, {
   3.717851942424342*^9, 3.7178519617417593`*^9}, {3.7179166385566483`*^9, 
   3.717916652130022*^9}, {3.717916702807887*^9, 3.717916757851202*^9}, {
   3.717916796898471*^9, 3.717916797584778*^9}, {3.7179168597055387`*^9, 
   3.7179168799813023`*^9}, {3.7179169623571787`*^9, 3.717916971272681*^9}, {
   3.717928823867218*^9, 3.717928843861143*^9}, {3.717931942625165*^9, 
   3.717931942894418*^9}, {3.717950307134776*^9, 3.71795032344585*^9}, {
   3.7179503956593943`*^9, 3.7179504833770247`*^9}, {3.718347755545013*^9, 
   3.718347756427464*^9}, {3.718348697054927*^9, 3.71834872303612*^9}, {
   3.718378812525331*^9, 3.7183790965031652`*^9}, 3.718379155071508*^9, {
   3.718433650236459*^9, 3.718433651802683*^9}, {3.718433684841159*^9, 
   3.718433703770782*^9}, {3.720762569498526*^9, 3.720762575349032*^9}, {
   3.720762780070977*^9, 3.7207627896775208`*^9}, {3.742027033473415*^9, 
   3.742027106009214*^9}, {3.7420271521617126`*^9, 3.742027566761835*^9}, {
   3.742027603881781*^9, 3.742027679126568*^9}, {3.742027717081161*^9, 
   3.742027916383613*^9}, {3.7441146944243393`*^9, 3.744114696423382*^9}, {
   3.747568043506074*^9, 3.7475680485584393`*^9}, {3.747568430787212*^9, 
   3.7475684719611464`*^9}, {3.761244417846724*^9, 3.76124442228309*^9}, {
   3.761244470264434*^9, 3.761244493067786*^9}, {3.761244897386915*^9, 
   3.761244910159872*^9}, {3.7612449406559467`*^9, 3.761244954455592*^9}, {
   3.761249627063087*^9, 3.76124970233836*^9}, {3.7619840552044153`*^9, 
   3.7619840606281147`*^9}, {3.7619841071462393`*^9, 3.761984152589323*^9}, {
   3.7619843318412724`*^9, 3.761984348791288*^9}, {3.7627512725903387`*^9, 
   3.762751272876742*^9}, {3.7637954061541367`*^9, 3.763795410933415*^9}, {
   3.7637954591020527`*^9, 3.763795459412326*^9}, 3.764955858844449*^9, {
   3.769495480801033*^9, 3.7694954920354958`*^9}, {3.769495534019821*^9, 
   3.7694955343067503`*^9}, {3.7712380374261017`*^9, 3.771238101559119*^9}, {
   3.779699718722555*^9, 3.779699725977388*^9}, {3.7796997726685677`*^9, 
   3.779699774218174*^9}, {3.779699930077063*^9, 3.779699951513096*^9}, {
   3.7838000328003473`*^9, 3.783800042334887*^9}, {3.78380010047132*^9, 
   3.783800115317122*^9}, {3.783800477966506*^9, 
   3.783800495348497*^9}},ExpressionUUID->"6a4cb8f6-310f-4db9-a782-\
88deb447f998"]
},
AutoGeneratedPackage->Automatic,
InitializationCellWarning->False,
WindowSize->{720, 800},
WindowMargins->{{114, Automatic}, {255, Automatic}},
FrontEndVersion->"12.0 for Mac OS X x86 (64-bit) (April 8, 2019)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[558, 20, 15628, 311, 2571, "Input",ExpressionUUID->"6a4cb8f6-310f-4db9-a782-88deb447f998",
 InitializationCell->True]
}
]
*)

